Merged
Conversation
Contributor
Prompt To Fix All With AIThis is a comment left during a code review.
Path: apps/code/src/renderer/features/code-review/utils/resolveDiffSource.test.ts
Line: 1-96
Comment:
**Prefer parameterised tests**
All 8 test cases call the same function with different inputs — this is exactly what `it.each` is for. Per the team's standard, parameterised tests are preferred.
```ts
describe("resolveDiffSource", () => {
it.each([
// heuristic (no user choice)
{ configured: null, hasLocalChanges: true, linkedBranch: "feat/x", aheadOfDefault: 3, expected: "local", desc: "uncommitted changes → local" },
{ configured: null, hasLocalChanges: false, linkedBranch: "feat/x", aheadOfDefault: 2, expected: "branch", desc: "clean tree with commits ahead → branch" },
{ configured: null, hasLocalChanges: false, linkedBranch: null, aheadOfDefault: 0, expected: "local", desc: "no linked branch → local" },
{ configured: null, hasLocalChanges: false, linkedBranch: "feat/x", aheadOfDefault: 0, expected: "local", desc: "no commits ahead → local" },
// explicit override
{ configured: "local", hasLocalChanges: false, linkedBranch: "feat/x", aheadOfDefault: 5, expected: "local", desc: "explicit local respected even when branch available" },
{ configured: "branch", hasLocalChanges: true, linkedBranch: "feat/x", aheadOfDefault: 1, expected: "branch", desc: "explicit branch respected when available" },
{ configured: "branch", hasLocalChanges: false, linkedBranch: null, aheadOfDefault: 0, expected: "local", desc: "explicit branch falls back to local (no linked branch)" },
{ configured: "branch", hasLocalChanges: false, linkedBranch: "feat/x", aheadOfDefault: 0, expected: "local", desc: "explicit branch falls back to local (no commits ahead)" },
] as const)("$desc", ({ configured, hasLocalChanges, linkedBranch, aheadOfDefault, expected }) => {
expect(resolveDiffSource({ configured, hasLocalChanges, linkedBranch, aheadOfDefault })).toBe(expected);
});
});
```
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: apps/code/src/renderer/features/code-review/components/ReviewPage.tsx
Line: 201-211
Comment:
**Misleading empty state when `repoSlug` is unavailable**
When `repoInfo` is `undefined` (e.g., `useGitQueries` hasn't resolved yet or the remote origin is unset), `repoSlug` is `null` and the query is disabled. `files` stays as `EMPTY_BRANCH_FILES`, so `isLoading` is `false` and `isEmpty` is `true`, causing "No file changes to review" to appear — even though the real issue is that the repo slug couldn't be determined. A user who has commits ahead of default would see this and think the feature is broken.
Consider checking `!repoSlug` explicitly and rendering a distinct message, or keeping `isLoading={isLoading || (!repoSlug && isReviewOpen)}` to show the spinner while metadata is still resolving.
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "feat(code): add diff source selector" | Re-trigger Greptile |
b07d98d to
d32d00a
Compare
jonathanlab
approved these changes
Apr 22, 2026
Contributor
Author
|
@jonathanlab good looks, thank you! i'll update this |
d32d00a to
768a644
Compare
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Problem
for local tasks we only show one diff - just the local diff state
this means when you push changes or open a PR, the diff panel becomes empty
Changes
adds a new diff source selector dropdown menu
right now it has two options:
this will include "PR" as an option soon!
How did you test this?
manully